package com.hanko.designpattern.strategy;

import java.util.*;

/**
 * 
 */
public class StrategyContext {
    Strategy strategy;

    public StrategyContext(String type) throws Exception {
        Class clazz = Class.forName(type);
        this.strategy = (Strategy) clazz.newInstance();
    }

    /**
     * 
     */
    public int context(int a, int b) {
        return strategy.operator(a,b);
    }

}